package com.joizhang.nettylecture.nio;

import java.nio.ByteBuffer;

/**
 * @author joizhang
 */
public class NioTest5 {

    public static void main(String[] args) {
        ByteBuffer buffer = ByteBuffer.allocate(26);
        // 4
        buffer.putInt(1);
        // 2
        buffer.putChar('X');
        // 8
        buffer.putDouble(3.14d);
        // 8
        buffer.putLong(Long.MAX_VALUE);
        // 4
        buffer.putFloat(3.14f);

        buffer.flip();

        System.out.println(buffer.getInt());
        System.out.println(buffer.getChar());
        System.out.println(buffer.getDouble());
        System.out.println(buffer.getLong());
        System.out.println(buffer.getFloat());
    }

}
